package com.ruoyi.gigi.record.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;

import java.time.LocalDateTime;

/**
 * 考勤记录管理对象 sign_in_record
 *
 * @author gigi
 * @date 2024-01-31
 */
@ContentRowHeight(30)  // 设置内容行高
@HeadRowHeight(30) // 设置头行高
@ColumnWidth(32) // 设置列宽
@ContentStyle(horizontalAlignment = HorizontalAlignment.LEFT) // 设置内容对其方式
@ContentFontStyle(fontHeightInPoints = 18) // 设置内容字体大小
@HeadFontStyle(fontHeightInPoints = 18) // 设置头字体大小
@HeadStyle(fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 40) // 设置头背景颜色
@ExcelIgnoreUnannotated // 未加注解的字段都不导出
public class SignInRecord extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @ExcelProperty("姓名")
    private String userName;

    @ExcelProperty("学号")
    private Long userNo;

    @ExcelProperty("班级")
    private String userClass;

    @ExcelProperty("签到状态")
    private String stateDesc;

    public String getStateDesc() {
        return stateDesc;
    }

    public void setStateDesc(String stateDesc) {
        this.stateDesc = stateDesc;
    }

    public String getSignInTimeStr() {
        return signInTimeStr;
    }

    public void setSignInTimeStr(String signInTimeStr) {
        this.signInTimeStr = signInTimeStr;
    }

    @ExcelProperty("签到时间")
    private String signInTimeStr;

    /**
     * 主键id
     */
    
    private Long id;

    /**
     * 签到id
     */
    
    private Long signInId;

    /**
     * 用户id（学生id）
     */
    
    private Long userId;

    /**
     * 考勤状态（0正常 1缺勤 2迟到 3请假）
     */
    
    private Integer state;

    /**
     * 签到时间
     */
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime signInTime;

    /**
     * 考勤照片
     */
    
    private String pic;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setSignInId(Long signInId) {
        this.signInId = signInId;
    }

    public Long getSignInId() {
        return signInId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getState() {
        return state;
    }

    public void setSignInTime(LocalDateTime signInTime) {
        this.signInTime = signInTime;
    }

    public LocalDateTime getSignInTime() {
        return signInTime;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Long getUserNo() {
        return userNo;
    }

    public void setUserNo(Long userNo) {
        this.userNo = userNo;
    }

    public String getUserClass() {
        return userClass;
    }

    public void setUserClass(String userClass) {
        this.userClass = userClass;
    }

    public String getPic() {
        return pic;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("signInId", getSignInId())
                .append("userId", getUserId())
                .append("state", getState())
                .append("signInTime", getSignInTime())
                .append("pic", getPic())
                .append("userName", getUserName())
                .append("userNo", getUserNo())
                .append("userClass", getUserClass())
                .append("stateDesc", getStateDesc())
                .append("signInTimeStr", getSignInTimeStr())
                .toString();
    }
}
